1. Field of the Invention
The present invention relates to a method, system, and program for accessing stored procedures in a message broker.
2. Description of the Related Art
The International Business Machines Corporation (xe2x80x9cIBMxe2x80x9d) MQ Series Integrator provides a messaging architecture to allow bi-directional data communication between message broker applications. Message brokers enable communication between businesses and between a business and consumers. A data flow defines connected nodes, where each node defines an operation to occur with respect to the message. Nodes typically process a single message at a time and feed single messages to downstream nodes. At the node, the content of the messages may be processed, transformed, and a new message generated to route to another node or location including the transformed data.
A data flow represents the sequence of operations performed on a message on the basis of rules that operate on the message""s format and content. Data flows are comprised of processing nodes and connectors. Processing nodes, which function as processing units, define procedures that perform a specific action on a message, and output zero or more messages as a result of that action. Connectors join the output points of one processing node to the input point of the next node in the data flow. During message construction, processing nodes receive messages from an input queue, perform the process specified for the processing node, and then place the transformed message on an output queue for a target recipient node. There are two basic types of processing nodes, endpoint nodes and compute nodes. End point nodes define end-points in the data flow to/from clients that may send/receive messages. Compute nodes perform the intermediate processing on the message, including reformatting, transforming, removing data, routing, archiving. Further, the node may merge information from a database into the message content or add data from the message to a database.
Notwithstanding the above capabilities of current message broker systems to interact with other applications, such as database applications, when processing a message, there is a need in the art to provide techniques to improve the manner in which the processing node interfaces with more complex applications, such as database applications.
Provided is a method, system, and program for processing a data flow. A message is received at an input node. The message is transferred to a plurality of nodes according to a defined data flow. At one stored procedure node, the message is processed to generate input parameters for a stored procedure call. The stored procedure node transfers the stored procedure call to a stored procedure at a server computer, wherein the server executes the stored procedure to process data and generate output.
Further, the stored procedure output is capable of comprising one or more result sets of data from the database table and/or one or more output parameters resulting from stored procedure operations performed on data in the database table.
Additionally, an output mapping is processed indicating how result set data is mapped to locations in the message.
Still further, the output mapping indicates a result set to element correspondence, wherein adding the data in the received result sets comprises adding the result set data to at least one element in the message.
In certain implementations, the message is in the Extensible Markup Language (XML) format, and the elements comprise XML tagged elements.
In additional implementations, a receiving node in the data flow receives output generated by a stored procedure program executing on a server after the stored procedure program completes execution. The receiving node adds data from the stored procedure output to at least one output message. The receiving node processes the output message according to the data flow.
The described implementations provide a technique to enable a node in a data flow to access stored procedure programs at a server and control the mapping of data in returned result sets to the message. Such implementations allow data flows to utilize the benefits of stored procedure programs and allow processing nodes in data flows to utilize the stored procedures that are available at database servers.